import type { RouteRecordRaw } from "vue-router";
/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      hidden：        是否隐藏此路由
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

/**
 * 静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      hidden: true,
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/error/404.vue"),
    meta: {
      hidden: true,
    },
  },
  
  {
    //"@/views/home/index.vue"
    path: "/",
    component: () => import("@/layout/index.vue"),
    redirect: "home",
    meta: {
      title: "控制台",
      icon: "ele-HomeFilled",
    },
    children: [
      {
        name: "Home",
        path: "/home",
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: "首页",
          icon: "ele-HomeFilled",
        },
      },
      {
        name:'Info',
        path:'/info',
        component: () => import("@/views/home/info.vue"),
        meta: {
          title: "个人信息",
          hidden: true,
          activeMenu: "/info",
        },
      }
    ],
  },

];

export const anyRoute = {
  /* 匹配任意的路由 必须最后注册 */
  path: "/:pathMatch(.*)",
  name: "Any",
  redirect: "/404",
  meta: {
    hidden: true,
  },
};

//异步路由
export const asyncRoute = [
  {
    name: "Acl",
    path: "/acl",
    component: () => import("@/layout/index.vue"),
    redirect: "/acl/user/list",
    meta: { title: "权限管理", icon: "ele-Setting" },
    children: [
      {
        name: "Logs",
        path: "/acl/Logs/list",
        component: () => import("@/views/acl/logs/index.vue"),
        meta: { title: "日志管理" },
      },
      {
        name: "User",
        path: "/acl/user/list",
        component: () => import("@/views/acl/user/index.vue"),
        meta: { title: "用户管理" },
      },
      {
        name: "Role",
        path: "/acl/role/list",
        component: () => import("@/views/acl/role/index.vue"),
        meta: {
          title: "角色管理",
        },
      },
      {
        name: "RoleAuth",
        path: "/acl/role/auth",
        component: () => import("@/views/acl/role/roleAuth.vue"),
        meta: {
          title: "角色管理",
          hidden: true,
          activeMenu: "acl/role/list",
        },
      },
      {
        name: "Permission",
        path: "/acl/permission/list",
        component: () => import("@/views/acl/permission/index.vue"),
        meta: {
          title: "菜单管理",
        },
      },
    ],
  },
  {
    path: "/product",
    component: () => import("@/layout/index.vue"),
    name: "Product",
    meta: {
      title: "facebook管理配置",
      icon: "ele-Goods",
    },
    children: [
      {
        path: "/product/trademark",
        component: () => import("@/views/product/trademark/index.vue"),
        name: "Trademark",
        meta: {
          title: "广告账户",
          icon: "ele-CreditCard",
        },
      },
      {
        path: "/product/attr",
        component: () => import("@/views/product/attr/index.vue"),
        name: "Attr",
        meta: {
          title: "公共主页",
          icon: "ele-TakeawayBox",
        },
      },
      {
        path: "/product/spu",
        component: () => import("@/views/product/spu/index.vue"),
        name: "Spu",
        meta: {
          title: "其他",
          icon: "ele-Drizzling",
        },
      },
    ],
  },
];
